package com.gxa.system_setting.controller;

import com.gxa.common.R;
import com.gxa.common.entity.system_settings.PlatformDistribution;
import com.gxa.system_setting.service.PlatformDistributionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PlatformDistributionController {

    @Autowired
    private PlatformDistributionService platformDistributionService;

    //分页
    @GetMapping("/PlatformDistribution")
    public R  queryPlatformDistributionList(Integer currentPage,Integer pageSize){
        return platformDistributionService.queryPlatformDistributionList(currentPage,pageSize);
    }

    //编辑
    @PostMapping("/updatePlatformDistribution")
    public R updatePlatformDistribution(@RequestBody PlatformDistribution platformDistribution){
        return platformDistributionService.updatePlatformDistribution(platformDistribution);
    }

    //禁用或者启用
    @GetMapping("/stopOrUse")
    public R stopOrUse(Long platform_distribution_id,Integer isFlag){
        return platformDistributionService.stopOrUse(platform_distribution_id,isFlag);
    }

    //条件查询
    @GetMapping("/queryByScopeApplicationOrStatus")
    public R queryByScopeApplicationOrStatus(String scopeApplication,Integer status){
        return platformDistributionService.queryByScopeApplicationOrStatus(scopeApplication,status);
    }

    //添加
    @PostMapping("/insertPlatformDistribution")
    public R insertPlatformDistribution(@RequestBody PlatformDistribution platformDistribution){
        return platformDistributionService.insertPlatformDistribution(platformDistribution);
    }
}
